
package com.market.web.action;

import java.util.Date;

import com.market.bean.Msgboard;

public class AdminMsgBSaveAction extends BaseAction2
{
    private int id;

    private String text;

    private String answer;

    private Date andate;

    private String name;

    private Date asdate;

    private String subject;

    private String curPage;

    /*public String getCurPage()
    {
        return curPage;
    }*/

    public void setCurPage(String curPage)
    {
        this.curPage = curPage;
    }

    public Date getAndate()
    {
        return andate;
    }

    public void setAndate(Date andate)
    {
        this.andate = andate;
    }

    public String getAnswer()
    {
        return answer;
    }

    public void setAnswer(String answer)
    {
        this.answer = answer;
    }

    public Date getAsdate()
    {
        return asdate;
    }

    public void setAsdate(Date asdate)
    {
        this.asdate = asdate;
    }

    public int getId()
    {
        return id;
    }

    public void setId(int id)
    {
        this.id = id;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public String getSubject()
    {
        return subject;
    }

    public void setSubject(String subject)
    {
        this.subject = subject;
    }

    public String getText()
    {
        return text;
    }

    public void setText(String text)
    {
        this.text = text;
    }
    
    public String execute() throws Exception
    {
        //MsgBoardForm mbf = (MsgBoardForm)form;
        Msgboard mb = getMsgBoardService().findById(getId());
        mb.setAnswer(getAnswer());
        mb.setAndate(new Date());
        getMsgBoardService().saveOrUpdate(mb);
        getRequest().setAttribute("page", getCurPage());
        return SUCCESS;
        //return new ActionForward("/adminMsgBSearch.do?page=" + mbf.getCurPage());
    }
}
